package com.sumu.today.models.permission.entity;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;

/**
 * <p>
 * 
 * </p>
 *
 * @author sumu
 * @since 2021-12-15
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId
    @NotEmpty(message="用户名不能为空！")
    private String name;

    @Size(min=6,max=10,message = "密码长度必须6到10位")
    private String password;

    private String age;

    private String email;

    private String phone;

    private String avatar;

    private String createTime;

    private String updateTime;


    public User(String name) {
        this.name = name;
    }

    public User(String name, String password, String email, String createTime) {
        this.name = name;
        this.password = password;
        this.email = email;
        this.createTime = createTime;
    }

    public User(String name, String password, String age, String email, String phone) {
        this.name = name;
        this.password = password;
        this.age = age;
        this.email = email;
        this.phone = phone;
    }
}
